{% extends "howto" %}

{% block main %}
<h2>wak.ini files format</h2>

<p>Each file have to include a meta-data file, named <q>wak.ini</q>, at the root of the kit. Here is the file's format description :</p>

<h3>[kit] section</h3>
<p>The first section contains kit-wide informations.</p>
<dl>
    <dt>version</dt>
    <dd>The kit's version number. Is used for dependancies.</dd>
    <dt>desc</dt>
    <dd>A short, one-line description</dd>
    <dt>phprange (optional but recommanded)</dt>
    <dd>Indicate for which PHP versions range the kit will work. Ex. 4.3-5.1 ou 5.*</dd>
    <dt>class (optional)</dt>
    <dd>The kit's instance class. <q>Webappkit</q> by default.</dd>
</dl>
<code>[kit]
; kit-wide meta informations
<var>version</var> = "0.1"
; kit version. Will be used later.
<var>desc</var> = "This is my first kit. It will rocks !"
; a short description. Single line to be INI compliant !
<var>phprange</var> = "4.3-5.*"
; define which PHP versions range compatibility (optional)
; you can use a single version string with jokers, as 4.*</code>

<h3>Libraries and dependancies</h3>
<p>Those sections tell which kits have to be loaded before, then which kit's files have to be included, and finally which subkits have to be loaded. They are all optional. Elements order is important and will be the order in which they will be loaded.</p>

<dl>
    <dt>[load_kits]</dt>
    <dd>Other kits to load before this one, as <var>index</var> = "kit id". Index value is not significant, only order is important.</dd>
    <dt>[load_files]</dt>
    <dd>Own PHP files to include, as <var>index</var> = "relative/path/to/file". Index value is not significant, only order is important. The path is relative to the kit's root.</dd>
    <dd>You can include a file for each PHP version, by naming them <q>.php4</q>, <q>.php5</q> etc. If so, indicate <q>.php*</q> in this list and the included file will be the one corresponding to the current PHP version.</dd>
    <dt>[load_classes]</dt>
    <dd>List class definition files. When running PHP5, they will by indexed and auto-loaded when requested in your scripts. When running PHP4, will be loaded just as [load_files]. You can use the <q>.php*</q> trick there too.</dd>
    <dt>[load_subkits]</dt>
    <dd>Subkits to load, as <var>index</var> = "subkit id". Index value is not significant, only order is important. The subkit id have to omit the parent kit id part. Ex. <q>hello.world</q> references here <q>example.hello.world</q></dd>
</dl>
<code>[load_kits]
; kits to load before self resources, order will be preserved.
; absolute.kit.id
webappkit.datapath = "1.2+"

[load_files]
; self resources to load, order will be preserved.
; n = "relative/path/to/file"
10 = "myclass.class.php4"
20 = "mychildclass.class.php*"

[load_classes]
; classes index
; class = "relative/path/to/definition/file"
; class names MUST be lower case
<var>anotherclass</var> = "lib/anotherclass.php*"

[load_subkits]
; subkits to load after self resources, order will be preserved
; relative.subkit.id = "version range"
hello.world = "*"</code>

<h3>[tools] section</h3>
<p>This section lists Kit's Tools members. Keys are member's name and values the class to use.</p>
<code>[tools]
; name = "class"
<var>realm</var> = "HttpRealmTool"</code>
<p>In this example, an <q>HttpRealmTool</q> instance will be available as <var>$kit</var>-&gt;<var>realm</var>.</p>
{% endblock %}
